﻿using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SmartCity.Shared;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;

namespace CommonManagement
{
    /// <summary>
    /// 充值控制器
    /// </summary>
    [Authorize]
    [RemoteService]
    [Area("commonManagement")]
    [Route("api/commonManagement/recharges")]
    public class RechargeController : AbpController, IRechargeAppService
    {
        private readonly IRechargeAppService _rechargeAppService;

        public RechargeController(
            IRechargeAppService rechargeAppService)
        {
            _rechargeAppService = rechargeAppService;
        }

        // 分页列表
        [HttpGet]
        [Route("list")]
        public Task<ListResponse<RechargeDto>> PagedListAsync(PagedListRequest request)
        {
            return _rechargeAppService.PagedListAsync(request);
        }

        // 充值
        [HttpPost]
        [Route("pay")]
        public Task<ActionResponse> PayAsync(RechargePayDto input)
        {
            return _rechargeAppService.PayAsync(input);
        }
    }
}